<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增任务')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-pet-add">
		<div class="form-group">
			<label class="col-sm-3 control-label">任务名称：</label>
			<div class="col-sm-8">
				<input type="text" name="name" class="form-control" placeholder="请输入任务名称">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">任务描述：</label>
			<div class="col-sm-8">
				<textarea id="describe" type="text" name="describe" class="form-control" placeholder="请输入任务描述"></textarea>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="col-sm-8">
				<textarea id="remark" type="text" name="remark" class="form-control" placeholder="请输入备注"></textarea>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
	function submitHandler() {
			add();
	}
	function add() {
		var name = $("input[name='name']").val();
		var describe = $("#describe").val();
		var remark = $('#remark').val();
		var formData = new FormData();
		formData.append('name', name);
		formData.append('remark', remark);
		formData.append('describe', describe);
		$.ajax({
			processData: false,
			contentType: false,
			cache : false,
			type : "POST",
			url : ctx + "system/task/add",
			data :formData,
			async : false,
			error : function(request) {
				$.modal.alertError("系统错误");
			},
			success : function(data) {
				$.operate.successCallback(data);
			}
		});
	}
</script>
</body>
</html>
